package org.emet.jee.console.entity.sys;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.emet.help.CGResource;
import org.emet.jee.console.entity.BaseEntity;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 存档
 * 
 * @author alex
 * 
 */
@Entity
@Table(name = "SYS_ARCH")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Archive extends BaseEntity {
	@CGResource("连接名称")
	private String name;
	//Datebase connection properties.
	@CGResource("数据库地址")
	private String jdbcServer;
	@CGResource("端口")
	private Integer jdbcPort;
	@CGResource("数据库")
	private String jdbcSchema;
	@CGResource("用户名")
	private String jdbcUsername;
	@CGResource("密码")
	private String jdbcPassword;

	@CGResource("备注")
	private String remark;

	@Column(unique = true, nullable = false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getJdbcServer() {
		return jdbcServer;
	}

	public void setJdbcServer(String jdbcServer) {
		this.jdbcServer = jdbcServer;
	}

	public Integer getJdbcPort() {
		return jdbcPort;
	}

	public void setJdbcPort(Integer jdbcPort) {
		this.jdbcPort = jdbcPort;
	}

	public String getJdbcSchema() {
		return jdbcSchema;
	}

	public void setJdbcSchema(String jdbcSchema) {
		this.jdbcSchema = jdbcSchema;
	}

	public String getJdbcUsername() {
		return jdbcUsername;
	}

	public void setJdbcUsername(String jdbcUsername) {
		this.jdbcUsername = jdbcUsername;
	}

	public String getJdbcPassword() {
		return jdbcPassword;
	}

	public void setJdbcPassword(String jdbcPassword) {
		this.jdbcPassword = jdbcPassword;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
